#ifndef __SCENE_H
#define __SCENE_H

#include <typeinfo>
#include <string>
#include <list>

#include <stdio.h>
#include "manager.h"

using namespace std;

class Scene
{
  public:
    Scene();
    ~Scene();

    void logicTick();
    void graphicTick();

    bool hasManager(const std::type_info& id);
    template<typename T> T* get()
    {
      list<Manager*>::iterator it=m_managers.begin();
      for(;it!=m_managers.end();it++)
      {
        if(typeid(*(*it))==typeid(T))
          return dynamic_cast<T*>(*it);
      }

      return 0;
    }

    void addManager(Manager* man);
    void removeManager(const std::type_info& id);

  protected:
    list<Manager*> m_managers;
};

#endif
